import {Select} from "antd";

type DictItem = {
    label: string;
    value: string;
    [key: string]: any;
}

export default function dictTag(options: DictItem[], value: string) {

    return <div>
        {options && options.find((item: any) => item.value == value)?.label}
    </div>
}


export function selectOptions(options: any) {
    return options && options.map((el: any, index: number) => (
        <Select.Option key={index} value={el.value.toString()}>
            {el.label}
        </Select.Option>
    ))
}
